home *** CD-ROM | disk | FTP | other *** search
- //////////////////////////////////////////////////////////////////////////
- // //
- // Unit Pixelshader //
- // //
- // Written by C. Granberg, 2006 //
- // //
- //////////////////////////////////////////////////////////////////////////
-
- sampler unitTexture;
- sampler fogOfWarTexture;
- uniform extern float4 tmCol;
-
- float4 Main(float4 vertCol : COLOR, float2 UV : TEXCOORD0, float2 UV2 : TEXCOORD1, float shade : TEXCOORD2) : COLOR
- {
- float4 c0 = tex2D(unitTexture, UV);
- float4 light = tex2D(fogOfWarTexture, UV2);
-
- //Calculate alpha inverse
- float Inv = 1.0f - c0.a;
-
- //Calculate team color
- float4 color = float4(c0.rgb * Inv + tmCol.rgb * c0.a, 1.0f);
-
- return color * light * vertCol * shade;
- }